package com.wang.home.find;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @Description
 * @Author shaopeng
 * @Date 2021/9/28
 * @Version 1.0
 */
public enum FindWorkerEnum {

    USER(null),
    LOCATION(null),
    CIRCLE(new FindWorkerEnum[]{USER, LOCATION}),
    SEA(new FindWorkerEnum[]{CIRCLE, USER}),
    SEA2(new FindWorkerEnum[]{CIRCLE, USER}),
    ;


    private Set<String> dependCodes;

    FindWorkerEnum(FindWorkerEnum[] depends) {
        if (depends != null) {
            dependCodes = Arrays.stream(depends).distinct().map(Enum::name).collect(Collectors.toSet());
        }
    }


    public Set<String> getDependCodes() {
        return dependCodes;
    }

}